import java.io.PrintWriter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;

public class Util {
    public static DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");	

	public static int max(int a, int b) {
		return a > b ? a : b;
	}

	public static void wait(Object obj) {
		Util.println("waiting..." + obj.toString());
		synchronized(obj){
			try {
				obj.wait();
			} catch (InterruptedException e) {
			}
		}
		Util.println("ended wait.");
	}

	public static void notify(Object obj){
		println("notify (" + obj.toString() + ")");
		synchronized(obj){
			obj.notify();
		}
	}
	public static void print(String s) {
		if (Constants.DEBUG) {
			System.out.print(s);
			System.out.flush();
		}
	}

	public static void println(String s) {
		if (Constants.DEBUG) {
			System.out.println(s);
			System.out.flush();
		}
	}

	static public void sendMsg(Msg msg, PrintWriter pout) {
		String msgStr = msg.toString();
		pout.println(msgStr);
		println("sendMsg(" + msgStr + ")");
		pout.flush();
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
